--File ： ChapterView.lua
--Author : zee
--Date   : 2015/4/8
--Description : 主界面，从scene来，用于组织所有的layer，层级等等。




RankItem = class("RankItem",function()
    -- 继承
    local ret = {}

    ret.start = nil
    return ret
end)

RankItem.__index = RankItem


function RankItem:create()
    local ret = RankItem:new()
    return ret
end




--------------------------------------------------------
-- 初始化
--------------------------------------------------------
function RankItem:bindToBode(rootNode)

    self.rootNode = rootNode

    self.have = SearchChildByName( self.rootNode, "have" )
    self.have_no = SearchChildByName( self.rootNode, "have_no" )
    -- 
    self.rankId = SearchChildByName( self.rootNode, "rankId" )
    self.name = SearchChildByName( self.rootNode, "name" )
    self.time = SearchChildByName( self.rootNode, "time" )
    self.score = SearchChildByName( self.rootNode, "score" )
end




function RankItem:setInfo( rankId, score, name, time )
    if( rankId==nil ) then 
        self.have:setVisible( false )
        self.have_no:setVisible( true )
        return
    end
    self.have_no:setVisible( false )
    self.have:setVisible( true )
    self.rankId:setString( ""..rankId.."." )
    self.name:setString( ""..name )
    self.time:setString( "时间 : "..time )
    self.score:setString( "得分 : "..score ) 
end









